<template>
  <van-submit-bar :price="allmonery" button-text="提交订单" @submit="onSubmit">
    <van-checkbox :checked="isallchecked" @click="handleallcheck(isallchecked)">全选</van-checkbox>
  </van-submit-bar>
</template>

<script>
import { computed } from 'vue'
import { useStore } from 'vuex'

export default {
  setup(props) {
    const store = useStore()
    const onSubmit = () => {
      console.log('提交')
    }
    const handleallcheck = (val) => {
      store.commit('car/changeallcheck', !val)
    }
    const allmonery = computed(() => {
      return store.getters['car/allmonery'] * 100
    })
    const isallchecked = computed(() => {
      return store.getters['car/isallchecked']
    })
    return {
      isallchecked,
      allmonery,
      onSubmit,
      handleallcheck
    }
  }
}
</script>

<style></style>
